﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AccessModel;
using DBUtility;
using MySql.Data.MySqlClient;

namespace AccessDAL
{
    public class RoleMenuDAL
    {
        #region
        public int CreateNewRoleMenu(List<RoleMenu> listRM)
        {            
            int i = 0;
            try
            {
                for (int j = 0; j <= listRM.Count; j++)
                {
                    RoleMenu rm = new RoleMenu();
                    rm = listRM[j];
                    string sql = "INSERT INTO ROLE (ROLEID,MENUID) VALUES (" + rm.RoleId + " " + rm.MenuId + ")";
                    i = DBUtility.MySqlHelper.ExecuteSql(sql);
                }                
            }
            catch (Exception)
            {
                throw;
            }

            return i;
        }
        #endregion
    }
}
